﻿using System.Collections.Generic;

/// <summary>
/// 提供对<see cref="IList{T}"/>的随机扩展支持
/// </summary>
public static class IListExtension
{
    /// <summary>
    /// 随机挑选一个元素 <typeparamref name="T"/>
    /// </summary>
    public static T Random<T>(this IList<T> self)
    {
        return self[winS.Unity.Random.Int(self.Count)];
    }
}